﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ include file="/common/include/page.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="${rootPath }/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" href="${rootPath}/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>产品分类</title>

</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 产品管理 <span class="c-gray en">&gt;</span> 课程管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
	<span class="l"><a class="btn btn-primary radius" onClick="layer_show('添加课程','${rootPath }/back/course.htm?type=add');" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加课程</a></span> <span class="r">共有数据：<strong>${courses.size() }</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg">
			<thead>
				<tr class="text-c">
					<th width="70">ID</th>
					<th width="100">课程名字</th>
					<th width="300">课程简介</th>
					<th width="100">课程图片</th>
					<th width="100">课程链接</th>
					<th width="100">课程所属分类</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${courses }" var="course">
				<tr class="text-c"  height="100">
					<td>${course.id }</td>
					<td>${course.courseName }</td>
					<td class="text-l"><img src="${rootPath}/static/h-ui.admin/images/cn.gif">${course.courseInstruction }</td>
					<td><img src="${rootPath}${course.courseImg }" style="width: 150px;"></td>
					<td class="text-l">${course.link}</td>
					<td class="text-l">${course.groupName}</td>
					<td class="f-14 product-brand-manage"><a style="text-decoration:none" onClick="layer_show('修改课程','${rootPath }/back/course.htm?type=edit&id=${course.id }');" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> <a style="text-decoration:none" class="ml-5" onClick="course_del(this,'${course.id}')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
		<nav aria-label="Page navigation" style="text-align: center;">
	  <ul class="pagination pagination-lg">
	    <li>
			<a href="${rootPath }/back/product-course.htm?currentPage=${pageInfoUtil.prePage}" aria-label="Previous">
				<span aria-hidden="true">&laquo;</span>
			</a>
		</li>
		<c:forEach begin="${pageInfoUtil.prePage}" end="${pageInfoUtil.nextPage>5?5:pageInfoUtil.nextPage}" var="page">
		    <li><a href="${rootPath }/back/product-course.htm?currentPage=${page}">${page }</a></li>
		</c:forEach>
	    <li>
			<a href="${rootPath }/back/product-course.htm?currentPage=${pageInfoUtil.nextPage}" aria-label="Next">
				<span aria-hidden="true">&raquo;</span>
		    </a>
	    </li>
	  </ul>
	</nav>
	</div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="${rootPath}/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${rootPath}/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${rootPath}/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${rootPath}/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="${rootPath}/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script> 
<script type="text/javascript">
if(window.top!=window.parent){
	window.parent.location.href=location.href;
}
/*课程-删除*/
function course_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: "${rootPath}/back/course_delete.htm?id="+id,
			/* dataType: 'json', */
			success: function(data){
				layer.msg('已删除!',{icon:1,time:1000});
				window.location.href="${rootPath}/back/product-course.htm"
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}
</script>
</body>
</html>